module.exports = (req,params,callback) => {
    const mysql = require('mysql');
    const conn = mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: '123',
        database: 'heroes'
    });
    conn.connect();
    conn.query(req, params, callback);
    conn.end()
}



// module.exports = (sql,params,callback) => {
//     const mysql = require('mysql');
//     const conn = mysql.createConnection({
//         host: 'localhost',
//         user: 'root',
//         password: '123',
//         database: 'abc'
//     })
//     conn.connect();
//     conn.query(sql,params,callback);
//     conn.end()
// }